package dflow.util;

import dflow.domain.EntityBase;

import java.util.List;
import java.util.Set;

/**
 * Created by dustin on 2017/7/16.
 */
public class ContainerUtil {
    public static <TEntity extends EntityBase<TKey>,TKey>  TEntity getItemById(List<TEntity> set, TKey id){
        for(EntityBase item :set){
            if(item.getId().equals(id))
                return (TEntity)item;
        }
        return null;
    }
}
